<template>
	<view class="body">
		<view class="mylist">
			<view v-if="mylist.length==0" style="text-align: center;margin-top: 150rpx;">您没有上传信息</view>
			<view class="list_item" v-for="item in mylist">
				<view class="list_title">
					<view class="item_type">
						{{item.dtype}}
					</view>
					<view class="item_time">
						<image src="../../static/time.png" style="width: 30rpx;height: 30rpx;margin-right: 6rpx;"></image>
						{{item.time}}
					</view>
				</view>
				<view class="list_body">
					<view class="info_degree">
						{{item.ddegree}}
					</view>
					<view class="list_text">
							{{item.dinfo}}
					</view>
					
					
				</view>
				<view class="list_foot">
					<view class="list_phone">
						<image src="../../static/phone.png" style="width: 30rpx;height: 30rpx;margin-right: 7rpx;"></image>
						{{item.dphone}}
					</view>
					<view class="list_location">
						<image src="../../static/loaction2.png" style="width: 30rpx;height: 30rpx;margin-right: 7rpx;"></image>
						{{item.dlocation}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mylist:[]
			}
		},
		onLoad() {
			this.getMyUpload()
		},
		onPullDownRefresh() {
		        console.log('refresh');
		        setTimeout( ()=> {			
					this.getMyUpload()
		            uni.stopPullDownRefresh();
		        }, 1000);
				
		    },
		methods: {
			getMyUpload(){
				uni.request({
					data:{
						uid:getApp().globalData.uid
					},
					url:'http://47.93.42.155:8080/WePrevent/GetMyUploadServlet',
					success: (res) => {
						uni.showToast({
							icon:"none",
							title:"成功"
						})
						this.mylist = res.data
						console.log(this.mylist[1].ddegree)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.body{
		padding-left: 20rpx;
		padding-right: 20rpx;
		.mylist{
			padding-top: 10rpx;
			.list_item{
				background-color: rgba($color: #edffff, $alpha: 0.1);
				border-radius: 20rpx;
				margin: 15px 0;
				
				box-shadow: 0rpx 0rpx 1rpx 7rpx rgba(0,0,0,0.1);
				
				.list_title{
					display: flex;
					align-items: center;
					background-color: #dafff4;
					border-radius:  10rpx 10rpx 0 0;
					font-size: 34rpx;
					
					
					z-index: -1;
					.item_type{
						width: 100%;
						padding-left: 20rpx;
						font-weight: bold;
						font-family: Arial,Helvetica,sans-serif;;
						//text-shadow: 2rpx 2rpx 5rpx rgba(0,0,0,1);
					}
					.item_time{
						flex-shrink: 0;
						font-size: 30rpx;
						padding-right: 20rpx;
						color: #333333;
						display: flex;
						
					}
				}
				.list_body{
					margin: auto 20rpx;
					.info_degree{
						font-size: 26rpx;
						color: #A71D5D;
					}
					.list_text{
						font-size: 28rpx;
					}
					
				}
				.list_foot{
					padding-top: 10rpx;
					padding-bottom: 10rpx;
					padding-left: 10rpx;
					display: flex;
					align-items: center;
					color: rgba(0,0,0,0.5);
					.list_phone{
						font-size: 28rpx;
						width: 30%;
						display: flex;
					}
					.list_location{
						font-size: 20rpx;
						width:70%;
						display: flex;
					}
				}
				
			}
		}
	}
</style>
